﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Masters/WithoutPermBasic.Master" AutoEventWireup="true" CodeBehind="ReceivePayInfo.aspx.cs" Inherits="PMS.UI.FM.ReceivePayInfo" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <script type="text/javascript">
        var height = $("#divTotal").height();
        var content = parseFloat(height) - 30;
        $("#tbList").css("height", content);
        method = com.get.method;
        receivePayID = com.get.Id;
        receivePayData = undefined;
        $(function () {
            if (method == "look") {
                $("a.easyui-linkbutton").linkbutton('disable')
            }
            if (method == "add") {
                $("#Date").datebox('setValue',datetools.day(new Date()))
            } else {
                com.ajax({
                    url: "/Logic/FM/ReceivePayAjax.aspx?method=GetReceivePayById",
                    data: { "Id": receivePayID },
                    success: function (data) {
                        receivePayData = data;
                        $("#form1").form("load", data);
                        $("#TaxpayerID").val(data.TaxpayerID);
                        $("#Bank").val(data.Bank);
                        $("#BankAccount").val(data.BankAccount);
                        $("#BankAccount").val(data.BankAccount);
                    }
                })
            };

            $("#CompanyID").combogrid({
                delay: 500,
                mode: 'remote',
                url: '/Logic/BD/CompanyAjax.aspx?method=GetAllCompanyInfo',
                idField: 'ID',
                textField: 'ComName',
                panelWidth: 524,
                columns: [[
                {
                    field: 'ID', title: 'ID', width: 40, align: 'center'
                },
                {
                    field: 'ComName', title: '客户名称', width: 120
                },
                {
                    field: 'TaxpayerID', title: '纳税人识别号', width: 120
                },
                {
                    field: 'Bank', title: '开户银行', width: 120
                },
                {
                    field: 'BankAccount', title: '账户', width: 120
                }
                ]],
                onSelect: function (rowindex, rowData) {
                    $('#TaxpayerID').val(rowData.TaxpayerID);
                    $('#Bank').val(rowData.Bank);
                    $('#BankAccount').val(rowData.BankAccount)
                }
            })
        })
    </script>

    <script type="text/javascript">

        function funcSave() {
            var g = $("#CompanyID").combogrid('grid');
            var company = g.datagrid('getSelected');
            if (null != company) {
                if ($("#form1").form('validate')) {
                    var getUrl = "/Logic/FM/ReceivePayAjax.aspx?method=";
                    if (method == "add") {
                        getUrl += "AddReceivePay"
                    } else {
                        getUrl += "EditReceivePay"
                    }
                    com.ajax({
                        url: getUrl,
                        data: com.serializeObj("form1"),
                        success: function (data) {
                            com.message(data.state, data.msg, function () { top.wrapper.tabClosethisRefreshByTitle('回款信息') });
                        }
                    })
                }
            } else {
                com.message('information', '请选择客户！')
            }
        }

    </script>
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder2" runat="server">
    <div id="InvoiceInfo" style="overflow: auto; padding: 20px; height: 100%; width: 100%">
        <div id="divToobar" style="background-color: #EFEFEF; overflow: visible">
            <a href="javascript:void(0)" id="btnSave" class="easyui-linkbutton" onclick="funcSave()"
                data-options="iconCls:'icon-save',plain:true">保存</a> &nbsp;&nbsp;
        </div>
        <div class="container_16" style="height: auto">
            <form id="form1">
                <div id="title" class="grid_16" style="text-align: center">
                    <h1>回款信息</h1>
                    <input type="hidden" id="ID" name="ID" />
                </div>
                <div class="grid_16">
                    <hr style="width: 100%; margin-left: 25px" />
                </div>
                <div class="grid_4 lbl" style="text-align: right;">
                    客户名称 :
                </div>
                <div class="grid_4 val" style="text-align: left;">
                    <input type="text" id="CompanyID" name="CompanyID" />
                </div>
                <div class="grid_4 lbl" style="text-align: right;">
                    纳税人识别号 :
                </div>
                <div class="grid_4 val" style="text-align: left;">
                    <input type="text" id="TaxpayerID" readonly="readonly" />
                </div>
                <div class="grid_4 lbl" style="text-align: right;">
                    开户银行 :
                </div>
                <div class="grid_4 val" style="text-align: left;">
                    <input type="text" id="Bank" readonly="readonly" />
                </div>
                <div class="grid_4 lbl" style="text-align: right;">
                    账户 :
                </div>
                <div class="grid_4 val" style="text-align: left;">
                    <input type="text" id="BankAccount" readonly="readonly" />
                </div>
                <div class="grid_16">
                    <hr style="width: 100%; margin-left: 25px" />
                </div>
                <div class="grid_4 lbl" style="text-align: right;">
                    回款流水号 :
                </div>
                <div class="grid_4 val" style="text-align: left;">
                    <input type="text" class="easyui-validatebox" id="PayNo" name="PayNo" data-options="required:true" />
                </div>
                <div class="grid_4 lbl" style="text-align: right;">
                    回款金额 :
                </div>
                <div class="grid_4 val" style="text-align: left;">
                    <input type="text" class="easyui-numberbox" id="Money" name="Money" data-options="min:0,precision:2" />
                </div>
                <div class="grid_4 lbl" style="text-align: right;">
                    回款日期 :
                </div>
                <div class="grid_4 val" style="text-align: left;">
                    <input type="text" class="easyui-datebox" id="Date" name="Date" />
                </div>
                <div class="grid_4 lbl" style="text-align: right;">
                    备注 :
                </div>
                <div class="grid_4 val" style="text-align: left;">
                    <input type="text" class="easyui-textbox" id="Note" name="Note" data-options="validateType:'length[0,250]'" />
                </div>
            </form>
        </div>
    </div>
</asp:Content>
